How opereating systems starup? You may ask this when you're reading linux's source code. Why hardware can execute the linux kernel? How did hardware find it? 

We know when CPU is starting, it should execute something. Operating Systems are all in disks (HD or SSD), but CPU can't read from any disks. It reads codes from memory, and execute it. 

So, hardware engineers write codes in ROM (Read-Only Memory) and let CPU execute it when it's starting. The name of codes in ROM is BIOS (Basic Input & Output System). 

BIOS initials all devices it can find. And then it read from the first sector in disk to 0x0000:0x7c00. It has a special name -- MBR (Master Boot Record). 
It checks the tail of this disk's MBR. If it's 0xAA55 (10101010 and 01010101 in binary), BIOS will execute that. 
Else, it read next disk's MBR. 

The size of a sector is only 512 bytes, it's too small. So all operating systems will read operating system's kernel from disk, and jump to it. 


So when CPU is starting, it will execute BIOS in ROM. BIOS will read MBR from disk and check its tail. MBR always read kernel from disk. 



BIOS: Basic Input & Output System
ROM:  Read-Only Memory
MBR:  Master Boot Record

Linux: A free i386 UNIX-like operating system kernel. 
sector: The smallest unit of disks. (Always 512 Bytes)

